<template>
    <div>
        <div>父组件 {{money}}</div>
         <div>子组件还剩的值是{{saveMoney}}</div>
                 <div>父组件接受子组件传过来的值: {{count1}}</div>
        <hr>
       <Son :money="money" @change="update" @change-money="updateMoney"/>
    </div>
</template>
<script>
import Son from './son.vue'
import {ref} from 'vue'
export default {
  name:'App',
  components:{
    Son

  },
  setup(){
   const money=ref(100)
   var count1=ref(0)
   const saveMoney=ref(100)
    const update=(newvalue)=>{
      // console.log(newvalue);
      count1.value=newvalue.value

    }
    const updateMoney=(newmoney)=>{
      saveMoney.value=newmoney

    }
    return {money,update,count1,saveMoney,updateMoney}

  }

}
    
</script>